﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Hired1Div.master" AutoEventWireup="true"
    CodeBehind="settings.aspx.cs" Inherits="Hired.settings" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <style type="text/css">
        .line_accountsettings
        {
            float: left;
            margin-left: 10px;
            width: 997px;
            height: 19px;
            background: url(images/lineAccountSettings.png);
        }
        .line_manageemployerpassports
        {
            float: left;
            margin-left: 10px;
            width: 997px;
            height: 19px;
            background: url(images/lineManageEmployers.png);
        }
        .line_deleteaccount
        {
            float: left;
            margin-left: 10px;
            width: 997px;
            height: 19px;
            background: url(images/lineDeleteAccount.png);
        }
        .style1
        {
            width: 60%;
            padding-top: 5px;
        }
        .style2
        {
            width: 210px;
            text-align: right;
            padding-right: 5px;
        }
        .btnUpdate
        {
            float: right;
        }
    </style>
    <script type="text/javascript">
        function ReenterPasswordValidate(source, args) {
            prompt($('[id$=txtReenterPassword]').attr('value'));
            if ($('[id$=txtNewPassword]').attr('value') != "" && $('[id$=txtNewPassword]').attr('value') != $('[id$=txtReenterPassword]').attr('value')) {
                args.IsValid = false;
            } else {
                args.IsValid = true;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPlaceHolder" runat="server">
    <div class="line_accountsettings">
    </div>
    <p>
        <strong>
            <asp:Label ID="lblConfirmation" runat="server"></asp:Label></strong>
    </p>
    <asp:Panel ID="pnlSettings" runat="server" DefaultButton="btnUpdate">
        <table class="style1">
            <tr>
                <td class="style2">
                    Username
                </td>
                <td>
                    <asp:Label ID="lblUsername" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Password
                </td>
                <td>
                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldPassword" runat="server" Display="Dynamic"
                        ErrorMessage="Required Field" Font-Size="X-Small" ForeColor="Red" ControlToValidate="txtPassword"
                        ValidationGroup="UpdateGroup"></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="CustomUpdatePassword" runat="server" ControlToValidate="txtPassword"
                        Display="Dynamic" ErrorMessage="Password is incorrect" Font-Size="X-Small" ForeColor="Red"
                        OnServerValidate="CustomUpdatePassword_ServerValidate" ValidationGroup="UpdateGroup"></asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    New password
                </td>
                <td>
                    <asp:TextBox ID="txtNewPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionNewPassword" runat="server"
                        ControlToValidate="txtNewPassword" Display="Dynamic" ErrorMessage="Password should contain only alphabets and numbers, and have a length of 6-18"
                        Font-Size="X-Small" ForeColor="Red" ValidationExpression="^[a-zA-Z0-9]{6,18}$"
                        ValidationGroup="UpdateGroup"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Re-enter new password
                </td>
                <td>
                    <asp:TextBox ID="txtReenterPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:CustomValidator ID="CustomValidatorReenterPassword" runat="server" ControlToValidate="txtReenterPassword"
                        Display="Dynamic" ErrorMessage="Passwords do not match" 
                        ClientValidationFunction="ReenterPasswordValidate" Font-Size="X-Small" 
                        ForeColor="Red" ValidationGroup="UpdateGroup"></asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    E-mail address
                </td>
                <td>
                    <asp:Label ID="lblEmail" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Security Question
                </td>
                <td>
                    <asp:DropDownList ID="ddlSecurityQuestion" runat="server">
                        <asp:ListItem>What is the name of your first teacher?</asp:ListItem>
                        <asp:ListItem>What is the name of your first pet?</asp:ListItem>
                        <asp:ListItem>What is the name of the first company you worked for?</asp:ListItem>
                        <asp:ListItem>What is the model of the first car you owned?</asp:ListItem>
                        <asp:ListItem>What was your favourite book as a child?</asp:ListItem>
                        <asp:ListItem>What was your favourite dessert as a child?</asp:ListItem>
                        <asp:ListItem>What was your favourite movie as a teenager?</asp:ListItem>
                        <asp:ListItem>Where did you take your first vacation?</asp:ListItem>
                        <asp:ListItem>Who was your favourite musical artist as a teenager?</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Security Answer
                </td>
                <td>
                    <asp:TextBox ID="txtSecurityAnswer" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldSecurityAnswer" runat="server" Display="Dynamic"
                        ErrorMessage="Required Field" Font-Size="X-Small" ForeColor="Red" ControlToValidate="txtSecurityAnswer"
                        ValidationGroup="UpdateGroup"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Allow messages from other users?
                </td>
                <td>
                    <asp:CheckBox ID="cbAllowMessages" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Allow notifications from Hired.com?
                </td>
                <td>
                    <asp:CheckBox ID="cbAllowNotifications" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Privacy Settings
                </td>
                <td>
                    <asp:DropDownList ID="ddlPrivacySettings" runat="server">
                        <asp:ListItem>Allow everyone</asp:ListItem>
                        <asp:ListItem>Allow buddies</asp:ListItem>
                        <asp:ListItem>Allow companies &amp; buddies</asp:ListItem>
                        <asp:ListItem>Allow companies</asp:ListItem>
                    </asp:DropDownList>
                    <a href="#" onclick="window.open('privacyinfo.aspx','privacysettings','width=400,height=100')">
                        <img src="Images/iconquestion.gif" /></a>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" CssClass="btnUpdate" OnClick="btnUpdate_Click"
                        ValidationGroup="UpdateGroup" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlEmployers" runat="server" Visible="false">
        <div class="line_manageemployerpassports">
        </div>
        <p>
            <a href="employer/create.aspx">Create a new employer passport</a>
            <br />
            <a href="employer/manage.aspx">Manage employer passports</a>
        </p>
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlDeleteAccount" runat="server" DefaultButton="btnDeleteAccount">
        <div class="line_deleteaccount">
        </div>
        <p>
            To delete your account, enter your password and click the button below.</p>
        <table width="50%">
            <tr>
                <td class="style2">
                    Password:
                </td>
                <td>
                    <asp:TextBox ID="txtDeletePassword" runat="server" TextMode="Password" />
                    <asp:RequiredFieldValidator ID="RequiredFieldDeletePassword" runat="server" ControlToValidate="txtDeletePassword"
                        Display="Dynamic" ErrorMessage="<br />Enter your password to delete account"
                        Font-Size="X-Small" ForeColor="Red" ValidationGroup="DeleteGroup"></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="CustomDeletePassword" runat="server" ControlToValidate="txtPassword"
                        Display="Dynamic" ErrorMessage="Password is incorrect" Font-Size="X-Small" ForeColor="Red"
                        OnServerValidate="CustomDeletePassword_ServerValidate" 
                        ValidationGroup="DeleteGroup"></asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnDeleteAccount" runat="server" Style="float: right;" Text="Delete account"
                        ValidationGroup="DeleteGroup" OnClick="btnDeleteAccount_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
